/*
 * @Author: whflovecn
 * @Date: 2021-05-31 15:48:34
 * @LastEditTime: 2021-05-31 16:01:05
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \complex\app\controller\menu.js
 */

"use strict";

const Controller = require("egg").Controller;

class Menu extends Controller {
  async getMenu() {
    const { ctx, service } = this;
    const accountID = ctx.params.accountID;
    if (ctx.request.header.operation.TREE) {
      ctx.body = await service.mysql.tree('meta', 'menu', 'id', ctx.request.body);
    } else {
      ctx.body = ctx.app.error(code.AUTH, `用户: ${accountID} 获取树权限不足！`);
    }
  }
}

module.exports = Menu